package com.bus.admin.controller;


import org.springframework.web.bind.annotation.RequestMapping;
import com.bus.admin.bean.result.ResultPage;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ResponseBody;

import com.bus.admin.bean.StationInfoLansi;
import com.bus.admin.bean.result.ResultPage;
import com.bus.admin.controller.model.ApiResultModel;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 站点信息 前端控制器
 * </p>
 *
 * @author 张子艺
 * @since 2020-04-01
 */
@Controller
@RequestMapping("/bus/stationInfoLansi")
public class StationInfoLansiController extends BaseController{
     /** 主页面 */
    @RequestMapping("main.html")
    public String main(){
       return  "trstation/StationInfoLansiMain";
    }
    /** 添加页面跳转
     * @return 返回页面
     */
    @RequestMapping(value = "/addStationInfoLansiHtml")
    public String addStationInfoLansiHtml( ){
             return "trstation/StationInfoLansiAdd";
    }
    /** 编辑页面跳转
     * @param  id  前端传进的参数
     * @return 返回页面
     */
    @RequestMapping(value = "/editStationInfoLansiHtml")
    public String editStationInfoLansiHtml(Integer id ,Model model ){
           model.addAttribute("stationInfoLansi",stationInfoLansiService.selectStationInfoLansiByIdStationInfoLansi(id));
             return "trstation/StationInfoLansiEdit";
    }

    /** 查看页面跳转
     * @param  id  前端传进的参数
     * @return 返回页面
     */
    @RequestMapping(value = "/showStationInfoLansiHtml")
    public String showStationInfoLansiHtml(Integer id ,Model model ){
           model.addAttribute("stationInfoLansi",stationInfoLansiService.selectStationInfoLansiByIdStationInfoLansi(id));
             return "trstation/StationInfoLansiShow";
    }


    /** 分页查询StationInfoLansi
     * @param page  页码
     * @param limit  查几条
     * @param stationInfoLansi  前端传进的参数
     * @return 返回统一分页信息
     */
    @RequestMapping(value = "/findStationInfoLansiByPage")
    @ResponseBody
    public ResultPage findStationInfoLansiByPage(Integer page, Integer limit,StationInfoLansi stationInfoLansi){
             return stationInfoLansiService.findStationInfoLansiByPage(page,limit,stationInfoLansi);
    }

    /** 添加StationInfoLansi
     * @param stationInfoLansi  前端传进的参数
     * @return 返回统一信息
     */
    @RequestMapping(value = "/addStationInfoLansi")
    @ResponseBody
    public ApiResultModel saveStationInfoLansi(StationInfoLansi stationInfoLansi  ){
             return stationInfoLansiService.addStationInfoLansi(stationInfoLansi);
    }

    /** 编辑StationInfoLansi
     * @param stationInfoLansi  前端传进的参数
     * @return 返回统一信息
     */
    @RequestMapping(value = "/editStationInfoLansi")
    @ResponseBody
    public ApiResultModel editStationInfoLansi(StationInfoLansi stationInfoLansi  ){
             return stationInfoLansiService.editStationInfoLansi(stationInfoLansi);
    }



    /** 删除一条StationInfoLansi
     * @param id  前端传进的ID
     * @return 返回统一信息
     */
    @RequestMapping(value = "/delStationInfoLansi")
    @ResponseBody
    public ApiResultModel delStationInfoLansi( Integer id  ){
             return stationInfoLansiService.delStationInfoLansi(id);
    }


}
